<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../common/top_css.jsp"%>
<script src="${pageContext.request.contextPath}/bootstrap/js/jquery.js"></script> <!-- jQuery -->
<script type="text/javascript">
	$(function(){
		//供应商
		$.ajax({
			url : "${pageContext.request.contextPath}/supplier/selectSupplierList.action",
			type : "POST",
			dataType : "json", 
			data : {},
			success : function(result, start, resp) {
				var str='';
				for ( var i = 0; i < result.length; i++) {
					str+='<option value="'+result[i].uuid+'">'+result[i].name+'</option>';
				}
				$("#selectID").append(str);
			}
		});
		//商品分类
		$.ajax({
			url : "${pageContext.request.contextPath}/goodsType/selectGoodsTypeList.action",
			type : "POST",
			dataType : "json", 
			data : {"supplieruuid":1},
			success : function(result, start, resp) {
				var str='';
				for ( var i = 0; i < result.length; i++) {
					str+='<option value="'+result[i].uuid+'">'+result[i].name+'</option>';
				}
				$("#selectID2").empty();
				$("#selectID2").append(str);
			}
		});
		$("#selectID").change(function(){
			var supplieruuid2=$("#selectID").val();
			$.ajax({
				url : "${pageContext.request.contextPath}/goodsType/selectGoodsTypeList.action",
				type : "POST",
				dataType : "json", 
				data : {"supplieruuid":supplieruuid2},
				success : function(result, start, resp) {
					var str='';
					for ( var i = 0; i < result.length; i++) {
						str+='<option value="'+result[i].uuid+'">'+result[i].name+'</option>';
					}
					$("#selectID2").empty();
					$("#selectID2").append(str);
				}
			});
		
		});
		
		//商品类别
		
	});
</script>

</head>

<body>
	<div class="navbar navbar-fixed-top bs-docs-nav" role="banner">
		<div class="conjtainer">
  			<%@ include file="../common/top_nav.jsp" %>
		</div>
	</div>


	<%@ include file="../common/top.jsp" %>
	<div class="content">
		<%@ include file="../common/left.jsp" %>
		<div class="mainbar">
		<%@ include file="../common/page-head.jsp" %>
			<div class="matter">
				<div class="container">
				<!-- 内容开始 -->
					<!-- 表单 -->
					<div class="widget wgreen">
		                <div class="widget-head">
		                  <div class="pull-left">搜索</div>
		                  <div class="widget-icons pull-right">
		                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> 
		                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
		                  </div>
		                  <div class="clearfix"></div>
		                </div>
		                <div class="widget-content">
		                  <div class="padd">
		                    <!-- Form starts.  -->
		                     <form class="form-horizontal" role="form" action="${pageContext.request.contextPath}/goods/insertGoods.action" method="post">
		                                <div class="form-group">
		                                  <label class="col-lg-2 control-label">供应商</label>
		                                  <div class="col-lg-4">
		                                    <select class="form-control" name="" id="selectID">
		                                    </select>
		                                  </div>
		                                  <label class="col-lg-2 control-label">商品类别</label>
		                                  <div class="col-lg-4">
		                                    <select class="form-control" name="goodstypeuuid" id="selectID2">
		                                    </select>
		                                  </div>
		                                </div>
		                                <div class="form-group">
		                                  <label class="col-lg-2 control-label">商品名称</label>
		                                  <div class="col-lg-4">
		                                    <input class="form-control" name="name" placeholder="商品名称" type="text">
		                                  </div>
		                                  <label class="col-lg-2 control-label">产地</label>
		                                  <div class="col-lg-4">
		                                    <input class="form-control" name="origin" placeholder="产地" type="text">
		                                  </div>
		                                </div>
		                                <div class="form-group">
		                                  <label class="col-lg-2 control-label">生成厂家</label>
		                                  <div class="col-lg-4">
		                                    <input class="form-control" name="producer" placeholder="生成厂家" type="text">
		                                  </div>
		                                  <label class="col-lg-2 control-label">单位</label>
		                                  <div class="col-lg-4">
		                                    <input class="form-control" name="unit" placeholder="单位" type="text">
		                                  </div>
		                                </div> 
		                                <div class="form-group">
		                                  <label class="col-lg-2 control-label">进货单价</label>
		                                  <div class="col-lg-4">
		                                    <input class="form-control" name="inprice" placeholder="进货单价" type="text">
		                                  </div>
		                                  <label class="col-lg-2 control-label">销售单价</label>
		                                  <div class="col-lg-4">
		                                    <input class="form-control" name="outprice" placeholder="销售单价" type="text">
		                                  </div>
		                                </div>    
		                                <hr>
		                                <div class="form-group">
		                                  <div class="col-lg-offset-1 col-lg-9">
		                                    <input type="submit"  class="btn btn-info" value="Add"/>
                                    		<input type="reset"  class="btn btn-default" value="Reset"/>
		                                  </div>
		                                </div>
		                              </form>
		                  </div>
		                </div>
		                  <div class="widget-foot">
		                    <!-- Footer goes here -->
		                  </div>
		              </div>
				<!-- 内容结束 -->
				</div>
			</div>
		</div>
	</div>
	<%@ include file="../common/footer.jsp" %>
 	<%@ include file="../common/footer_js.jsp" %>
</body>
</html>
